{% extends 'base.html.twig' %}

{% block title %}
    GaoAPI
{% endblock %}

{% block stylesheets %}
    <link rel="stylesheet" type="text/css" href="{{ asset('swagger-ui/dist/swagger-ui.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ asset('css/front/default/index.css') }}">
{% endblock %}

{% block body %}

    <div id="swagger-ui">
        <section data-reactroot="" class="swagger-ui swagger-container">

            <div class="topbar">
                <div class="wrapper">
                    <div class="topbar-wrapper">
                        <a href="/" style="flex:none;"><img height="40" src="{{ asset('images/gaoapi-logo.svg') }}" alt="GaoAPI" style="margin-right: 10px;">GaoAPI</a>
                        <a rel="noopener noreferrer" class="link">
                            <img height="40" src="/images/symfony-logo.svg" alt="Symfony" style="margin: 0 30px">
                            <img height="40"
                                 src=""
                                 alt="Swagger UI">
                        </a>
                    </div>
                </div>
            </div>

            <div class="swagger-ui">
                <div class="information-container wrapper">
                    {% if pagination.getTotalItemCount > 0 %}
                        {% for info in pagination %}
                            <section class="block col-12">
                                <div>
                                    <div class="info">
                                        <hgroup class="main">
                                            <h2 class="title">
                                                <span class="title" style="font-size: 36px;">
                                                    {{ info.title }}
                                                </span>
                                                <span>
                                            <small><pre class="version">{{ info.version }}</pre></small>
                                            <small style="background-color: rgb(137, 191, 4);"><pre class="version">OAS3</pre></small>
                                        </span>
                                            </h2>
                                        </hgroup>
                                        <div class="description">
                                            <div class="renderedMarkdown"><p>{{ info.description }}</p></div>
                                        </div>
                                        <div class="action">
                                            <ul class="action-ul">
                                                <li><a href="{{ path('swagger_tag_page', {tag: info.tag}) }}"
                                                       target="_blank">Swagger</a></li>
                                                <li><a href="{{ path('document_tag_page', {tag: info.tag}) }}"
                                                       target="_blank">Document</a></li>
                                            </ul>
                                        </div>
                                        <hr class="hr-style-one">
                                    </div>
                                </div>
                            </section>
                        {% endfor %}
                    {% else %}
                        暂无数据
                    {% endif %}
                    <div class="text-center">
                        {{ knp_pagination_render(pagination) }}
                    </div>
                </div>
            </div>
        </section>
    </div>

{% endblock %}